Add xc_init_store python binding.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Wed, 27 Jul 2005 17:06:02 +0000 (17:06 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Wed, 27 Jul 2005 17:06:02 +0000 (17:06 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
tools/python/xen/lowlevel/xc/xc.c

index cf625b0df0a213a759296cd6027ff83c0c659f6a..46e2ba25b306d71d412a9ec7b2d1645297e7a78e 100644 (file)
@@ -813,6 +813,22 @@ static PyObject *pyxc_domain_memory_increase_reservation(PyObject *self,
     return zero;
 }
 
+static PyObject *pyxc_init_store(PyObject *self, PyObject *args,
+                                PyObject *kwds)
+{
+    XcObject *xc = (XcObject *)self;
+
+    int remote_port;
+
+    static char *kwd_list[] = { "remote_port", NULL };
+
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, 
+                                      &remote_port) )
+        return NULL;
+
+    return PyInt_FromLong(xc_init_store(xc->xc_handle, remote_port));
+}
+
 
 static PyMethodDef pyxc_methods[] = {
     { "handle",
@@ -1088,6 +1104,13 @@ static PyMethodDef pyxc_methods[] = {
       " mem_kb [long]: .\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
 
+    { "init_store", 
+      (PyCFunction)pyxc_init_store, 
+      METH_VARARGS | METH_KEYWORDS, "\n"
+      "Initialize the store event channel and return the store page mfn.\n"
+      " remote_port [int]: store event channel port number.\n"
+      "Returns: [int] mfn on success; <0 on error.\n" },
+
     { NULL, NULL, 0, NULL }
 };